﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;

public partial class service_wsjf : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["username"] != null && Session["userpwd"] != null)
            {
                string userName = Session["username"].ToString();
                string userpwd = Session["userpwd"].ToString();
                this.hidName.Value = userName;
                this.hidPwd.Value = userpwd;
                this.lblUser.Text = userName;
            }
            else
            {
                Response.Redirect("service_self.aspx");
            }
        }
    }
    /// <summary>
    /// 网上积分
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void imgbtnwsjf_Click(object sender, ImageClickEventArgs e)
    {
        //WebUserDAL bll = new WebUserDAL();
        //string userName = wname.Text;
        //string pwd = wpwd.Text;
        //string code = this.code.Text;
        //string c = (string)Session["code"];
        //if (c.Trim().ToLower() == code.Trim())
        //{
        //    bool regLogin = bll.Web_Login(userName, pwd);
        //    if (regLogin == false)
        //    {
        //        ClientScript.RegisterStartupScript(GetType(), "a", "alert('用户验证失败，请重新输入');", true);
        //        return;
        //    }
        //    DataRow userRow = bll.GetWebUserByUserName(userName);
        //    DataTable integralTb = bll.GetIntegralByUserName(userName);
        //    DataRow integralRow = integralTb.Rows[0];
        //    DataTable integralDetailTb = bll.GetIntegralDetailByUserName(userName);

        //    ArrayList lst = new ArrayList();
        //    for (int i = 0; i < integralDetailTb.Rows.Count; i++)
        //    {
        //        System.Data.DataRow row = integralDetailTb.Rows[i];
        //        var tt = new { xh = i + 1, dTime = Convert.ToString(row["setup_date"]), content = Convert.ToString(row["content"]), fz = Convert.ToString(row["integral"]) };
        //        lst.Add(tt);
        //    }
        //    //稍等。。。
        //    var user = new
        //    {
        //        cardId = Convert.ToString(userRow["softuser"]),
        //        name = Convert.ToString(userRow["truename"]),
        //        mobile = Convert.ToString(userRow["mobile"]),
        //        address = Convert.ToString(userRow["province"]) + " " + Convert.ToString(userRow["city"]) + " " + Convert.ToString(userRow["address"]),
        //        jf = Convert.ToString(integralRow["integral"]),
        //        kyJf = Convert.ToString(integralRow["integral"]),
        //        detail = lst
        //    };
        //    lab_EMCard.InnerText = user.cardId;
        //    lab_UserName.InnerText = user.name;
        //    lab_Tel.InnerText = user.mobile;
        //    lab_Address.InnerText = user.address;
        //    lab_Total.InnerText = user.jf;
        //    lab_Can.InnerText = user.kyJf;
        //}
        //else
        //{
        //    ClientScript.RegisterStartupScript(GetType(), "a", "alert('验证码输入不正确');", true);
        //}
    }
}